/*
 * @Author: your name
 * @Date: 2021-12-08 15:29:07
 * @LastEditTime: 2021-12-08 17:03:14
 * @LastEditors: Please set LastEditors
 * @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 * @FilePath: /vite_vue3_ts/src/mock/user/user.ts
 */
import Mock from 'mockjs';
import { resultSuccess } from '../_util';

const Random = Mock.Random;

const token = Random.string('upper', 32, 32);

const adminInfo = {
  userId: '1',
  username: 'admin',
  realName: 'admin',
  avatar: Random.image(),
  desc: 'manager',
  password: Random.string('upper', 4, 16),
  token
};

export default [
  {
    url: '/login',
    timeout: 1000,
    method: 'post',
    response: () => {
      return resultSuccess({ token });
    }
  },
  {
    url: '/getUserInfo',
    timeout: 1000,
    method: 'get',
    response: () => {
      return resultSuccess(adminInfo);
    }
  }
];
